import { permission,permissionAll } from '@/utils/permission'

// 对 x-auths 的所有权限进行验证, 全部通过认为成功

export default {
	mounted(el, binding) {
		const { value } = binding
		if(Array.isArray(value)){
			let has = permissionAll(value);
			if (!has){
				el.parentNode.removeChild(el)
			}
		}else{
			if(!permission(value)){
				el.parentNode.removeChild(el);
			}
		}
	}
};
